package cn.tedu.web.servlet2;

import cn.tedu.web.sww.JdbcUtils;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/user/disabledsww")
public class UserDisabledServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws  IOException {
        String id = req.getParameter("id");
        String sql = "UPDATE `user` SET `disabled` =1 WHERE id = ?";
        JdbcUtils.modify(sql,id);
        resp.sendRedirect("/sww/user-list.jsp");
    }
}
